package com.hankol.community.adapter

import com.baselibrary.utils.GlideUtils
import com.baselibrary.utils.TimeUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.community.PulCourseActivity
import com.hankol.community.R
import com.hankol.community.bean.PulpitListBean

/**
 * @author: 关忆北、
 * @date: 2022/4/27
 * @Des：讲坛视频 往期内容 视频列表
 */
class PulClassroomAdapter(var activity: PulCourseActivity, var pulCourseId: Int) :
        BaseQuickAdapter<PulpitListBean, BaseViewHolder>(R.layout.item_pul_classroom) {
    override fun convert(helper: BaseViewHolder, bean: PulpitListBean) {
        if (pulCourseId.toLong() == bean.id) activity.videoPos = helper.adapterPosition
        helper
                .setText(R.id.iv_pul_room_time, TimeUtil.getRuleTime(bean.ctime, "yyyy-MM-dd"))
                .setText(R.id.tv_pul_room_title, bean.title)

        GlideUtils.loadImg_101(mContext.applicationContext, bean.cover, helper.getView(R.id.iv_pul_room_cover))
    }
}